//package com.example.ui.service.feign;
//
//import com.example.ui.pojo.Person;
//import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.stereotype.Service;
//
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * 使用feign调用producer服务
// *
// * @author 86188
// */
//@Service
//public class ProducerHystrixService {
//
//    @Autowired
//    private ProducerService producerService;
//
//    @HystrixCommand(fallbackMethod = "fallbackSave")//当该方法调用失败时,调用fallbackSave方法
//    public List<Person> save(String name) {
//        return producerService.save(name);
//    }
//
//    public List<Person> fallbackSave(String name) {
//        List<Person> people = new ArrayList<>();
//        Person p = new Person();
//        p.setName("故障");
//        people.add(p);
//        return people;
//    }
//
//}
